#斐波拉契数列
#P37048 （2021-4-2）

fblq =int(input("求该值的斐波拉契数列："))
pre_num = 0
nex_num = 1
count = 2

if fblq < 0:
    print("请输入一个正整数！")
    exit()
elif fblq == 1:
    print('斐波拉契数列为：',nex_num)
else:
    print('斐波拉契数列为：',pre_num,',',nex_num,end=' , ')
    while count < fblq:
        tmp_num = pre_num + nex_num
        print(tmp_num,end=' , ')
        pre_num = nex_num
        nex_num = tmp_num
        count += 1

# 后续讲到递归的话，在用递归试下